package wc.Dao;

import wc.domain.Admin;
import wc.domain.History;
import wc.domain.User;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * @ClassName:AdminDao
 * @Author: 鹿建文
 * @Date: 2022/4/6  - 10:21
 * @Describe:
 */
public interface AdminDao {
    /**
     * 根据id查找admin
     * @param id
     * @return
     */
    Admin selectById (Integer id) throws SQLException;

    /**
     * 根据账户查找admin
     * @param account
     * @return
     */
    Admin selectByAccount (String account) throws SQLException;

    /**
     * 修改密码
     * @param id
     * @param password
     * @return
     * @throws SQLException
     */
    boolean updatePassword(Integer id,String password) throws SQLException;

    /**
     * 修改盐值
     * @param id
     * @param salt
     * @return
     */
    boolean updateSalt(Integer id,String salt) throws SQLException;

    /**
     * 跟新盐值
     *
     * @return
     * @throws SQLException
     */
    int updateAllSaltAndPassword() throws SQLException;

    /**
     * 增加用户
     * @param user
     * @return
     * @throws SQLException
     */
    boolean createUser(User user) throws SQLException;

    /**
     * 查询用户详细信息
     * @return
     * @throws SQLException
     */
    List<User> selectAllUsersDetailed() throws SQLException;

    /**
     * 查询用户列表
     * @return
     * @throws SQLException
     */
    HashMap<Integer, List> selectAllUsersList() throws SQLException;

    /**
     * 查询指定用户积分
     * @return
     * @throws SQLException
     */
    HashMap<Integer,List> selectUserCredits( String name) throws SQLException;


    /**
     * 查询指定用户积分记录
     * @return
     * @throws SQLException
     */

    ArrayList<History> selectUserCreditsHistorye(Integer userId) throws SQLException;

}
